package stu.day25_day32.day25.all;

public class LeetCode226 {
    public TreeNode invertTree(TreeNode root) {

        if(root==null){
            return null;
        }
        if(root.right==null && root.left==null){
            return root;
        }

        TreeNode l = invertTree(root.left);
        TreeNode r = invertTree(root.right);

        root.left=r;
        root.right=l;

        return root;
    }
}
